import Vue from "vue";
import Router from "vue-router";
import Index from "./views/Index.vue";
import Landing from "./views/Landing.vue";
import Login from "./views/Login.vue";
import Profile from "./views/Profile.vue";
import MainNavbar from "./layout/MainNavbar.vue";
import MainFooter from "./layout/MainFooter.vue";
import Landing2 from "./views/Landing2.vue";
import Landing3 from "./views/Landing3.vue";
import Teach from "./views/Teach.vue";
import Register from "./views/Register.vue";
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "index",
      components: { default: Index, header: MainNavbar, footer: MainFooter },
      props: {
        header: { colorOnScroll: 400 },
        footer: { backgroundColor: "black" }
      }
    },
	{
	  path: "/",
	  name: "login",
	  components: { default: Login, header: MainNavbar, footer: MainFooter },
	  props: {
	    header: { colorOnScroll: 400 },
	    footer: { backgroundColor: "black" }
	  }
	},
    {
      path: "/landing",
      /* 更改了名字*/
      name: "material-icons",
      components: { default: Landing, header: MainNavbar, footer: MainFooter },
      props: {
        header: { colorOnScroll: 400 },
        footer: { backgroundColor: "black" }
      }
    },
    {
      path: "/landing2",
      /* 专业老师的名字*/
      name: "material-icons",
      components: { default: Landing2, header: MainNavbar, footer: MainFooter },
      props: {
        header: { colorOnScroll: 400 },
        footer: { backgroundColor: "black" }
      }
    },
    {
      path: "/landing3",
      /* 职业老师的名字*/
      name: "material-icons",
      components: { default: Landing3, header: MainNavbar, footer: MainFooter },
      props: {
        header: { colorOnScroll: 400 },
        footer: { backgroundColor: "black" }
      }
    },
    {
      path: "/login",
      name: "login",
      components: { default: Login, header: MainNavbar, footer: MainFooter },
      props: {
        header: { colorOnScroll: 400 }
      }
    },
    {
      path: "/profile",
      name: "profile",
      components: { default: Profile, header: MainNavbar, footer: MainFooter },
      props: {
        header: { colorOnScroll: 400 },
        footer: { backgroundColor: "black" }
      }
    },
	{
	  path: "/teach",
	  name: "teach",
	  components: { default: Teach, header: MainNavbar, footer: MainFooter },
	  props: {
	    header: { colorOnScroll: 400 },
	    footer: { backgroundColor: "black" }
	  }
	},
	{
	  path: "/register",
	  name: "register",
	  components: { default: Register, header: MainNavbar, footer: MainFooter },
	  props: {
	    header: { colorOnScroll: 400 },
	    footer: { backgroundColor: "black" }
	  }
	}
  ],
  scrollBehavior: to => {
    if (to.hash) {
      return { selector: to.hash };
    } else {
      return { x: 0, y: 0 };
    }
  }
});
